package com.rop.znyx.user.api;

import com.rop.znyx.common.result.Result;
import com.rop.znyx.user.service.LeaderService;
import com.rop.znyx.user.service.UserService;
import com.rop.znyx.vo.user.LeaderAddressVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA
 * User: Rop
 * Date: 2023/7/19
 * Time: 15:03
 * Description:
 */

@Api(tags = "团长接口")
@RestController
@RequestMapping("api/user/leader/inner")
@RequiredArgsConstructor
public class LeaderApiController {

    private final UserService userService;

    private final LeaderService leaderService;

    @ApiOperation("提货点地址信息")
    @GetMapping("getUserAddressByUserId/{userId}")
    public Result<LeaderAddressVo> getUserAddressByUserId(@PathVariable("userId") Long userId) {
        return Result.ok(userService.getLeaderAddressByUserId(userId));
    }
}
